﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using Pcb.Common;

namespace Pcb.Web.tools
{
    /// <summary>
    /// company_ajax 的摘要说明
    /// </summary>
    public class company_ajax : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            //取得处事类型
            string action = DTRequest.GetQueryString("action");

            switch (action)
            {
                case "article_detail": //加载关于我们，联系我们等信息
                    article_detail(context);
                    break;
             
            }

        }

        /// <summary>
        /// 加载关于我们，联系我们等信息
        /// </summary>
        /// <param name="context"></param>
        private void article_detail(HttpContext context)
        {            
            BLL.article bll = new BLL.article();
            string typeId = DTRequest.GetString("typeId");

            Model.article_content info = new Model.article_content();

            if (typeId == "1")
                info = bll.GetModel("  channel_id = 5 and title ='关于我们'");
            else if (typeId == "2")
                info = bll.GetModel("  channel_id = 5 and title ='联系我们'");
                        
            string newTxt = info.content;
            context.Response.Write(newTxt);
            return;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}